<html>

<head>
    <title>010横向滑动菜单</title>
    <meta charset="utf-8">
    <style>
        a:link,
        a:visited,
        a:hover,
        a:active {
            color: #2C58E7;
            text-decoration: none;
        }

        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        #container {
            position: relative;
            margin: 0 auto;
            top: 50%;
            transform: translateY(-50%);

            width: 800px;
            height: 500px;
            background-color: #ccc;
            border: 1px solid black;
        }

        /************** CSS ***************/
        ul{
            list-style: none;
        }
        #one li{
            display: inline-block;
            width: 80px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border: 1px solid #777;
            background: linear-gradient(white, #39F);
            position: relative;
        }
        #one li:hover, #one li:hover div{
            cursor: pointer;
            background: #39F;
            margin-right: 50px;
        }
        #one li>div{
            display: inline-block;
            width: 50px;
            height: 30px;
            left: 80px;
            top: -1px;
            position: absolute;
            border-top: 1px solid #777;
            border-right: 1px solid #777;
            border-bottom: 1px solid #777;
        }
        /************** CSS ***************/
        #two{
            display: flex;
            width: 320px;
        }
        #two li{
            display: inline-block;
            flex-grow: 1;
            box-sizing: border-box;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border-top: 1px solid #777;
            border-left: 1px solid #777;
            border-bottom: 1px solid #777;
            background: linear-gradient(white, #39F);
            position: relative;
            transition: margin 0.3s;
        }
        #two li span{
            display: inline-block;
            position: absolute;
            width: 50px;
            right: -50px;
            top: -1px;
            margin: 0;
            padding: 0;
            height: 100%;
            border-top: 1px solid #777;
            border-right: 1px solid #777;
            border-bottom: 1px solid #777;
            background: linear-gradient(white, #39F);
        }
        #two li:not(#no):hover{
            cursor: pointer;
            background: #39F;
            margin-right: 50px;
        }
        #two li:hover span{
            cursor: pointer;
            background: #39F;
        }
    </style>
</head>

<body>
    <div id="container">
            <ul id="one">
                <li>AAA<div>HHH</div>
                </li><li>BBB<div>HHH</div>
                </li><li>CCC<div>HHH</div>
                </li><li>DDD</li>
            </ul>
            <ul id="two">
                <li>AAA<span>HHH</span>
                </li><li>BBB<span>HHH</span>
                </li><li>CCC<span>HHH</span>
                </li><li>DDD<span>HHH</span>
                </li><li>EEE<span>HHH</span>
                </li><li id="no">---</li>
            </ul>
    </div>
</body>

</html>